package rd.hardcore.engine.sample {
	import flash.utils.ByteArray;
	import flash.utils.IDataOutput;

	/**
	 * @author plepers
	 */
	public class SampleDatas {

		
		public function writeRange ( dest : IDataOutput ) : void {
			dest.writeBytes( _rawDatas, _startPos, _endPos - _startPos );
		}
		
		
		public function get rawDatas () : ByteArray {
			return _rawDatas;
		}
		
		public function set rawDatas (rawDatas : ByteArray) : void {
			_rawDatas = rawDatas;
		}
		

		private var _rawDatas : ByteArray;

		private var _startPos : int = -1;
		private var _endPos : int = -1;
		
		public function get startPos () : int {
			return ( _startPos < 0 ) ? 0 : _startPos;
		}

		public function set startPos (startPos : int) : void {
			_startPos = startPos;
		}
		
		public function get endPos () : int {
			return ( _endPos < 0 ) ? _rawDatas.length : _startPos;
		}

		public function set endPos (endPos : int) : void {
			_endPos = endPos;
		}
	}
}
